package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.account.RechargeInfo;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.model.account.UserAccountDetail;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {


    BigDecimal getAvailableAmount();

    Result<AccountLockResultVo> checkAndLockAmount(AccountLockVo accountLockVo);

    /**
     * 记录账户用户流水的
     * @param userId
     * @param content
     * @param amount
     * @param orderNo
     */
    void log(Long userId,BigDecimal amount, String content, String orderNo,String tradeType);

    RechargeInfo getRechargeInfoByOrderNo(String orderNo, Long userId);


    IPage<UserAccountDetail> findUserConsumePage(IPage<UserAccountDetail> page, Long userId);

    IPage<UserAccountDetail> findUserRechargePage(IPage<UserAccountDetail> page, Long userId);
}
